const { model } = require('../db')
const schema = require('../schemas/stu')

class stuModel{ 
    constructor () { 
        this.db = model( 'Admin', schema );
    }
    store ( data ) { 
        return this.db.insertMany( data );
    }
    find () { 
        return this.db.find();
    }
    search ( data ) { 
        return this.db.find( { username: data.username }, { _id: 0 } );
    }
    del ( data ) { 
        return this.db.deleteOne( {_id:data.id});
    }
}
module.exports = new stuModel